package cn.yu.meeting.login.service;

import cn.yu.meeting.login.mapper.LoginMapper;
import cn.yu.meeting.user.mapper.UserMapper;
import cn.yu.meeting.user.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginService {

    @Autowired
    private LoginMapper loginMapper;

    @Autowired
    private UserMapper userMapper;

    /**
     * 根据账号查询用户
     *
     * @param account 账号
     */
    public User findByAccount(String account) {
        return userMapper.findByAccount(account);
    }

    /**
     * 根据手机号注册
     *
     * @param account 手机号
     * @param pwd     密码
     */
    public void registerByMobile(String account, String pwd) {
        userMapper.add(account, pwd);
    }
}
